<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/business/include/doctype.jsp" %>
<script type="text/javascript" src="${requestScope.contextPath}/js/cubiq-iscroll/iscroll.js"></script>
<script type="text/javascript">
var myScroll;
function loaded() {
	myScroll = new iScroll('wrapper', { 
		checkDOMChanges: true,
		zoom: false
	});
}
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
window.addEventListener('DOMContentLoaded', setTimeout(function () { loaded(); }, 200), false);

</script>
<link rel="stylesheet" type="text/css" href="${requestScope.contextPath}/js/jquery-ui-1.8.14.custom/css/ui-lightness/jquery-ui-1.8.14.custom.css" />
<script type="text/javascript">

function goSearch() {
	var frm = document.accessSearch;
	if(frm.startdate.value == "" && frm.enddate.value == "") {
		alert("검색일을 선택하세요.");
		return false;
	}else{
		return true;
	}
	return false;
}

$(function() {
	var dates = $('#startdate, #enddate').datepicker({
		showOn: "button",
		buttonImage: "${requestScope.contextPath}/images/reservation/cal1.gif",
		buttonImageOnly: true,
		numberOfMonths: 1,
		dateFormat: 'yy-mm-dd',
		showMonthAfterYear:true,
		monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
		dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
		showButtonPanel: true,
		onSelect: function(selectedDate) {
			var option = this.id == "startdate" ? "minDate" : "maxDate";
			var instance = $(this).data("datepicker");
			var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
			dates.not(this).datepicker("option", option, date);
		}
	});
});
</script>
<style type="text/css" media="all">
/*원본 : #wrapper { position:absolute; z-index:1; top:135px; bottom:0px; left:0; width:320px; overflow:auto; }*/
#wrapper { position:absolute; z-index:1; top:135px; bottom:0px; left:0; width:100%; overflow:auto; }
#scroller { position:absolute; -webkit-tap-highlight-color:rgba(0,0,0,0); width:100%; padding:0; background:#fff; }
</style>
</head>
<body>
	<div id="wrap">
		<div class="header">
			<h1>출입관리</h1>
		</div><!-- // header -->
		<div class="content">
			<div class="table5">
				<form name="accessSearch" method="get" action="${requestScope.contextPath}/business/mAccessMan/mAccessManApplySearch.do" onsubmit="return goSearch();">
					<table summary="" cellspacing="0" style="width:100%">
						<caption>출입관리</caption>
						<colgroup>
							<col style="width:15%" />
							<col style="width:25%" />
							<col style="width:60%" />
						</colgroup>
						<tbody>
							<tr>
								<th scope="row">날짜</th>
								<td colspan="2">
									<input type="text" name="startdate" class="intxt4" value="${startdate}" id="startdate" readonly="readonly" /> ~ <input type="text" name="enddate" title="날짜검색" class="intxt4" value="${enddate }" id="enddate" readonly="readonly" />
								</td>
							</tr>
							<tr>
								<th scope="row">제목</th>
								<td><select name="searchType" style="width:100%;">
										<option value="searchdata" <c:if test="${searchType eq 'searchdata'}">selected="selected"</c:if> >이름</option>
										<option value="companyname" <c:if test="${searchType eq 'companyname'}">selected="selected"</c:if> >회사명</option>
									</select></td>
								<td>
									<input type="text" name="searchVal" id="sTid" value="${searchVal}" style="width:50%;" /> <input type="image" src="${requestScope.contextPath}/images/btn/btn_search2.gif" />
								</td>
							</tr>
						</tbody>
					</table>
					</form>
				</div>
		</div><!-- // content -->
		<div id="wrapper" class="access">
			<div id="scroller">
			
				<ul class="news">
					<c:forEach items="${mapList}" var="mapInfo" varStatus="status">
					<li><a href="${requestScope.contextPath}/business/mAccessMan/mAccessManApplyView.do?ApplySeq=${mapInfo.APPLY_SEQ}"><span class="bold">${mapInfo.RESERVATION_DATE }</span><span class="date1">${mapInfo.VISITOR_NAME }, ${mapInfo.VISITOR_COMP_NAME }</span></a>
					<span class="status">
					<c:choose>
					<c:when test="${mapInfo.VISITOR_STATUS == '01'}">
						미방문
					</c:when>
	       			<c:when test="${mapInfo.VISITOR_STATUS == '02'}">
						방문중
					</c:when>
					<c:when test="${mapInfo.VISITOR_STATUS == '03'}">
						방문완료
					</c:when>
					<c:when test="${mapInfo.VISITOR_STATUS == '99'}">
						분실
					</c:when>
					</c:choose>
					</span>
					</li>
					</c:forEach>
					<c:if test="${empty mapList}">
					<li>일치하는 자료가 없습니다.</li>
					</c:if>
				</ul>
			</div>
		</div>
	</div><!-- // wrap -->
</body>
</html>